Skip to content

Conversation

@deirn
Copy link
Member

@deirn deirn commented Feb 2, 2026

Move the decompiling logic to workers.
Also cache decompiled result to IndexedDB.

TODO:

  • Fix Vineflower options
  • Fix spinner indicator
  • Decompile the entire Jar at once?

Related to #11

@deirn deirn marked this pull request as draft February 2, 2026 10:13
@modmuss50
Copy link
Member

This is something I have tried a few times and got working. However the big issue was always how slow decompling the entire jar is, hopefully I was just being silly as it would be great if this could be done.

@deirn
Copy link
Member Author

deirn commented Feb 2, 2026

I'll try forcing it to decompile the entire Jar first and then time it.

@deirn
Copy link
Member Author

deirn commented Feb 2, 2026

Latest commit decompiles the entire Jar in 11 minutes, which is not too bad, IMO. What do you think?

Details

image

@CelDaemon
Copy link

Latest commit decompiles the entire Jar in 11 minutes, which is not too bad, IMO. What do you think?

It's cool, but I think it's unreasonable to make the user wait for 11 minutes for the site to be ready. Especially if we want to be able to link to it from the docs for example.

@deirn
Copy link
Member Author

deirn commented Feb 2, 2026

I imagine it not being enabled by default, and only so for when you want to index the entire Jar, e.g. for full code search, as in #11.

Copy link
Member

@modmuss50 modmuss50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just taken a quick look at this it looks good. There is quite a lot going on here, at some stuff that I need to get familar with. I do worry a little bit that this is going to cause browsers to fall over, where it was previously working just fine.

The requirement of the added headers is also less than ideal, but it seems there is no nice way around that.

package.json Outdated
"@katana-project/zip": "^0.7.1",
"@monaco-editor/react": "^4.7.0",
"@run-slicer/vf": "^0.3.2-1.11.2",
"@run-slicer/vf": "git+https://github.com/deirn/vineflower.js.git#7a257563c0352acf232313612146eae82b5919bf",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note before merging, use a proper version.

@modmuss50
Copy link
Member

Would it be possible to add some E2E tests for this, or is it too slow? It would be nice to have some confidence that it works on the 3 main browsers.

@deirn deirn marked this pull request as ready for review February 8, 2026 15:42
@deirn
Copy link
Member Author

deirn commented Feb 8, 2026

I say this PR is ready for actual review.

Added E2E test for decompiling some classes by stopping as early after one class is decompiled.
This should test the worker setup and whatnot.

@modmuss50
Copy link
Member

Awesome, thanks for that. Ill take a closer look shortly. Do I need to do anything special in cloudflare to add the headers or is that magically handled by the _headers file?

@deirn
Copy link
Member Author

deirn commented Feb 8, 2026

CF should handle it automatically by the _headers file.

@modmuss50
Copy link
Member

I think this is looking good, is the fork of VF still required?

@deirn
Copy link
Member Author

deirn commented Feb 10, 2026

Yeah since it uses new API that I added. Still unreleased.
katana-project/vf#4

I can transfer my fork into FabricMC org if you want.

CC: @zlataovce

@modmuss50
Copy link
Member

I seem to be getting an error when running this in chrome dev:

client.ts:113 Uncaught ReferenceError: SharedArrayBuffer is not defined
    at decompileEntireJar (client.ts:113:9)
    at onOk (JarDecompilerModal.tsx:29:22)

Firefox seems fine, as does the e2e test. Am I doing something wrong?

@CelDaemon
Copy link

SharedArrayBuffer was disabled by default in modern chrome due to security issues. I think it now requires adding some specific HTTP security headers to re-enable.

@zlataovce
Copy link
Contributor

Yeah since it uses new API that I added. Still unreleased. katana-project/vf#4

I can transfer my fork into FabricMC org if you want.

CC: @zlataovce

I will look into publishing it today

@deirn
Copy link
Member Author

deirn commented Feb 10, 2026

I seem to be getting an error when running this in chrome dev:

Hm, not sure, it worked when I tried it, both on Chrome stable and Dev. What if you use the production build?
npm run build && npm run preview

SharedArrayBuffer was disabled by default in modern chrome due to security issues. I think it now requires adding some specific HTTP security headers to re-enable.

This PR already accounts for that.

@deirn
Copy link
Member Author

deirn commented Feb 11, 2026

Changed to use official VF release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants